import React, { Component } from 'react'
import BetterScroll from 'better-scroll'
export default class App extends Component {
    state={
        list:['中文明细','23实际相关的21','dadwad','23213','dwdad2','中文明细','23实际相关的21','dadwad','23213','dwdad2','中文明细','23实际相关的21','dadwad','23213','dwdad2','中文明细','23实际相关的21','dadwad','23213','dwdad2']
    }
    componentWillMount(){
console.log(document.querySelectorAll("li"))
    }
    componentDidMount(){
        console.log(document.querySelectorAll("li"))
        new BetterScroll('#wrapper')
    }
  render() {
    return (
      <div>
          <div id='wrapper' style={{height:"180px",backgroundColor:"pink",overflow:"hidden"}}>
              <ul>
                  {
                      this.state.list.map((item,index)=>
                        <li key={index*2}>{item}</li>
                        )
                  }
              </ul>
          </div>
      </div>
    )
  }
}
